﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LogManager.Base;
using Newtonsoft.Json;

namespace LogManager.Base
{
    public class EventImport : IEventImport
    {
        /// <summary>
        /// Id of import
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// Wether the import is completed or not
        /// </summary>
        public bool Completed { get; set; }

        [JsonIgnore]
        public int Progress
        {
            get
            {
                return (int)(((decimal)Amount / (decimal)ExcpectedAmount)*100);
            }
        }

        public DateTime ImportDate { get; set; }

        //Source:
        public string ServerName { get; set; }
        public string LogName { get; set; }

        //Import information
        public DateTime Start { get; set; }
        public DateTime End { get; set; }
        
        //These are the amount of imported events
        public int Amount { get; set; }

        //The amount that assumingly will be imported
        public int ExcpectedAmount { get; set; }
    }   
}
